3.290 \(\int \cos ^2(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\)

Optimal. Leaf size=80 \[ \frac {1}{2} x \left (a^2 A+4 a b B+2 A b^2\right )+\frac {a^2 A \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a (a B+2 A b) \sin (c+d x)}{d}+\frac {b^2 B \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

1/2*(A*a^2+2*A*b^2+4*B*a*b)*x+b^2*B*arctanh(sin(d*x+c))/d+a*(2*A*b+B*a)*sin(d*x+c)/d+1/2*a^2*A*cos(d*x+c)*sin(
d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 80, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.161, Rules used = {4024, 4047, 8, 4045, 3770} \[ \frac {1}{2} x \left (a^2 A+4 a b B+2 A b^2\right )+\frac {a^2 A \sin (c+d x) \cos (c+d x)}{2 d}+\frac {a (a B+2 A b) \sin (c+d x)}{d}+\frac {b^2 B \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

((a^2*A + 2*A*b^2 + 4*a*b*B)*x)/2 + (b^2*B*ArcTanh[Sin[c + d*x]])/d + (a*(2*A*b + a*B)*Sin[c + d*x])/d + (a^2*
A*Cos[c + d*x]*Sin[c + d*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4024

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^2*(csc[(e_.) + (f_.)*(x_)]*(B_
.) + (A_)), x_Symbol] :> Simp[(a^2*A*Cos[e + f*x]*(d*Csc[e + f*x])^(n + 1))/(d*f*n), x] + Dist[1/(d*n), Int[(d
*Csc[e + f*x])^(n + 1)*(a*(2*A*b + a*B)*n + (2*a*b*B*n + A*(b^2*n + a^2*(n + 1)))*Csc[e + f*x] + b^2*B*n*Csc[e
 + f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]

Rule 4045

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(A*Cot[e
 + f*x]*(b*Csc[e + f*x])^m)/(f*m), x] + Dist[(C*m + A*(m + 1))/(b^2*m), Int[(b*Csc[e + f*x])^(m + 2), x], x] /
; FreeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]

Rule 4047

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(
C_.)), x_Symbol] :> Dist[B/b, Int[(b*Csc[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x
]^2), x] /; FreeQ[{b, e, f, A, B, C, m}, x]

Rubi steps

\begin {align*} \int \cos ^2(c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx &=\frac {a^2 A \cos (c+d x) \sin (c+d x)}{2 d}-\frac {1}{2} \int \cos (c+d x) \left (-2 a (2 A b+a B)+\left (A \left (-a^2-2 b^2\right )-4 a b B\right ) \sec (c+d x)-2 b^2 B \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a^2 A \cos (c+d x) \sin (c+d x)}{2 d}-\frac {1}{2} \int \cos (c+d x) \left (-2 a (2 A b+a B)-2 b^2 B \sec ^2(c+d x)\right ) \, dx-\frac {1}{2} \left (-a^2 A-2 A b^2-4 a b B\right ) \int 1 \, dx\\ &=\frac {1}{2} \left (a^2 A+2 A b^2+4 a b B\right ) x+\frac {a (2 A b+a B) \sin (c+d x)}{d}+\frac {a^2 A \cos (c+d x) \sin (c+d x)}{2 d}+\left (b^2 B\right ) \int \sec (c+d x) \, dx\\ &=\frac {1}{2} \left (a^2 A+2 A b^2+4 a b B\right ) x+\frac {b^2 B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a (2 A b+a B) \sin (c+d x)}{d}+\frac {a^2 A \cos (c+d x) \sin (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.23, size = 120, normalized size = 1.50 \[ \frac {2 (c+d x) \left (a^2 A+4 a b B+2 A b^2\right )+a^2 A \sin (2 (c+d x))+4 a (a B+2 A b) \sin (c+d x)-4 b^2 B \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+4 b^2 B \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

(2*(a^2*A + 2*A*b^2 + 4*a*b*B)*(c + d*x) - 4*b^2*B*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 4*b^2*B*Log[Cos[
(c + d*x)/2] + Sin[(c + d*x)/2]] + 4*a*(2*A*b + a*B)*Sin[c + d*x] + a^2*A*Sin[2*(c + d*x)])/(4*d)

________________________________________________________________________________________

fricas [A]  time = 0.47, size = 87, normalized size = 1.09 \[ \frac {B b^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - B b^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (A a^{2} + 4 \, B a b + 2 \, A b^{2}\right )} d x + {\left (A a^{2} \cos \left (d x + c\right ) + 2 \, B a^{2} + 4 \, A a b\right )} \sin \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(B*b^2*log(sin(d*x + c) + 1) - B*b^2*log(-sin(d*x + c) + 1) + (A*a^2 + 4*B*a*b + 2*A*b^2)*d*x + (A*a^2*cos
(d*x + c) + 2*B*a^2 + 4*A*a*b)*sin(d*x + c))/d

________________________________________________________________________________________

giac [B]  time = 0.45, size = 178, normalized size = 2.22 \[ \frac {2 \, B b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, B b^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + {\left (A a^{2} + 4 \, B a b + 2 \, A b^{2}\right )} {\left (d x + c\right )} - \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

1/2*(2*B*b^2*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 2*B*b^2*log(abs(tan(1/2*d*x + 1/2*c) - 1)) + (A*a^2 + 4*B*a*
b + 2*A*b^2)*(d*x + c) - 2*(A*a^2*tan(1/2*d*x + 1/2*c)^3 - 2*B*a^2*tan(1/2*d*x + 1/2*c)^3 - 4*A*a*b*tan(1/2*d*
x + 1/2*c)^3 - A*a^2*tan(1/2*d*x + 1/2*c) - 2*B*a^2*tan(1/2*d*x + 1/2*c) - 4*A*a*b*tan(1/2*d*x + 1/2*c))/(tan(
1/2*d*x + 1/2*c)^2 + 1)^2)/d

________________________________________________________________________________________

maple [A]  time = 0.71, size = 120, normalized size = 1.50 \[ \frac {a^{2} A \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}+\frac {a^{2} A x}{2}+\frac {A \,a^{2} c}{2 d}+\frac {B \,a^{2} \sin \left (d x +c \right )}{d}+\frac {2 A a b \sin \left (d x +c \right )}{d}+2 B x a b +\frac {2 B a b c}{d}+A x \,b^{2}+\frac {A \,b^{2} c}{d}+\frac {b^{2} B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x)

[Out]

1/2*a^2*A*cos(d*x+c)*sin(d*x+c)/d+1/2*a^2*A*x+1/2/d*A*a^2*c+1/d*B*a^2*sin(d*x+c)+2/d*A*a*b*sin(d*x+c)+2*B*x*a*
b+2/d*B*a*b*c+A*x*b^2+1/d*A*b^2*c+1/d*b^2*B*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.88, size = 99, normalized size = 1.24 \[ \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{2} + 8 \, {\left (d x + c\right )} B a b + 4 \, {\left (d x + c\right )} A b^{2} + 2 \, B b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, B a^{2} \sin \left (d x + c\right ) + 8 \, A a b \sin \left (d x + c\right )}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*A*a^2 + 8*(d*x + c)*B*a*b + 4*(d*x + c)*A*b^2 + 2*B*b^2*(log(sin(d*x + c
) + 1) - log(sin(d*x + c) - 1)) + 4*B*a^2*sin(d*x + c) + 8*A*a*b*sin(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 2.38, size = 169, normalized size = 2.11 \[ \frac {B\,a^2\,\sin \left (c+d\,x\right )}{d}+\frac {A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,A\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {2\,A\,a\,b\,\sin \left (c+d\,x\right )}{d}+\frac {4\,B\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2*(A + B/cos(c + d*x))*(a + b/cos(c + d*x))^2,x)

[Out]

(B*a^2*sin(c + d*x))/d + (A*a^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*A*b^2*atan(sin(c/2 + (d*x)
/2)/cos(c/2 + (d*x)/2)))/d + (2*B*b^2*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (A*a^2*sin(2*c + 2*d*x
))/(4*d) + (2*A*a*b*sin(c + d*x))/d + (4*B*a*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(a+b*sec(d*x+c))**2*(A+B*sec(d*x+c)),x)

[Out]

Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))**2*cos(c + d*x)**2, x)

________________________________________________________________________________________